import fetch from "../../utils/http/fetch.js";
import consts from "../../utils/http/consts.js";

const ROOT = "./cs/org";

export default {
  list(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/list`);
  },
  new(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/new`);
  },
  update(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/update`);
  },
  delete(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/delete`);
  },
  sort(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/ud`);
  },
  level(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/level`); // 获取盟市、县单位列表
  },
  type(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/type`); // 类型列表
  },
  detail(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/list/detail`); // 详情
  },
  duty(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/rescue/duty`); // 救援队伍
  },
  mount(data, suc, err) {
    return fetch(
      data,
      suc,
      err,
      consts.HttpMethod.POST,
      `${ROOT}/source/mount`
    ); //防护目标资源统计
  },
  source(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/source/list`); //防护目标预设列表
  },
  orgDetail(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/detail`); //统计预设机构人数
  },
  preDetail(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/pre-detail`); //预设机构弹窗详情查询
  },
};
